package leetcode;

import org.junit.Test;

import java.util.Scanner;

/**
 * @author cino
 * justCode
 */
public class leetcode392 {

    @Test
    public void test() {
        String s = "abc";
        String t = "ahbgdc";
        System.out.println(isSubsequence(s,t));
    }
    public boolean isSubsequence(String s,String t){
        int i = 0;
        int j = 0;
        while(i < s.length() && j < t.length()){
            if (s.charAt(i) == t.charAt(j)){
                i++;
            }
            j++;
        }
        return i == s.length();
    }
}
